<template>  
	<view v-if="item" @click="goDetail(item)" class="wf-page2" :style="viewColor">
		<view class='pictrue skeleton-rect'>
			<!-- <image :src='item.image[0]' mode="widthFix"></image> -->
           
            <text v-if="userUid==uid"class="iconfont icon-shanchu2" @click.stop="delMydata()"></text>
            
			<easy-loadimage class="image" mode="widthFix" :image-src="item.image[0]"></easy-loadimage>
			<view v-if="isShow" class="plant-show">
				<text v-if="item.is_type == 1" class="iconfont icon-tuwen1"></text>
				<text v-else-if="item.is_type == 2" class="iconfont icon-shipin1"></text>
			</view>
			<view v-else-if="item.is_type == 2" class="video_img">
				<image class="image" src="../../static/images/stop.png" mode=""></image>
			</view>
			<view v-if="isAuth && tab == 0 && item.status != 1" class="approval_status">
				<view v-if="item.status == -1" class="approval_title">审核未通过</view>
				<view v-else-if="item.status == -2" class="approval_title">已下架</view>
				<view v-else-if="item.status == 0" class="approval_title">正在审核</view>
				<text v-if="item.status == -1 || item.status == -2" class="approval_info">查看未通过原因</text>
				<text v-if="item.status == 0" class="approval_info">通过后将展示在列表</text>
			</view>
		</view>
		<view class='text'>
			<view class='name skeleton-rect'>
				<text class="text_name line2">{{item.title}}
				</text>				
			</view>
			<view class="count acea-row skeleton-rect">
				<view v-if="!isAuth" class="author acea-row">
					<image class="image" :src="(item.author && item.author.avatar) || '/static/images/f.png'"></image>
					<!-- <text class="author_name line1">{{item.author && item.author.nickname}}</text> -->
				</view>
				<view v-else class="author acea-row">
					<text class="author_time">
					{{item.time}}
					</text>
				</view>
                <view class="like">
                    <text class="iconfont icon-shoucang" ></text>
                    <text class="collect">{{item.count_start}}</text>
                </view>
                <view class="like" >
                    <text class="iconfont icon-shoucang2" ></text>
                    <text class="collect">{{item.count_collections}}</text>
                </view>
				<view class="like" >
                    <text class="iconfont icon-pinglun1" ></text>
                    <text class="collect">{{item.count_reply}}</text>
				</view>
			</view>
		</view>	
	</view>
</template>
<script>
// +----------------------------------------------------------------------
// | ju [星际明星娱乐-寻找好声音]
// +----------------------------------------------------------------------
// | Copyright (c) 2024 https://jufeiniu.com/ All rights reserved.
// +----------------------------------------------------------------------
// | Author: 巨说还行-乔欣弥弥-巨肥牛 <jufeiniu@163.com>
// +----------------------------------------------------------------------
// | Personal site: https://jufeiniu.com/
// +----------------------------------------------------------------------	
import easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue'
import { mapGetters } from "vuex";
export default {
	components:{easyLoadimage},
	computed: {...mapGetters(['viewColor'])},
    props: {
			item: {
					type: Object,
					require: true
			},
			type: {
				type: Number,
				default: 0
			},
			isAuth: {
				type: Number || String,
				default: 0
			},
			uid: {
				type: Number || String,
				default: 0
			},
			tab: {
				type: Number,
				default: 1
			},
			isFind: {
				type: Boolean,
				default: false
			},
			isShow: {
				type: Boolean,
				default: false
			},
    },
	data() {
		return {
            userUid:uni.getStorageSync('UID')
		};
	},
	
	methods: {	
		likeToggle(item){
			this.$emit('likeToggle',item)
		},
        delMydata(){
            this.$emit('delete',this.item)
        },
		goDetail(item){
			if(this.isFind){
				uni.navigateTo({
					url: '/pages/plantGrass/plant_featured/index?id='+item.topic_id
				});	
			}else{
				this.plantDeail(item)
			}
		},
		plantDeail(item){
			if(item.is_type == 1){
				// uni.navigateTo({
				// 	url: '/pages/plantGrass/plant_detail/index?id='+item.community_id
				// });
                uni.navigateTo({
                	//#ifdef APP
                	url: '/pages/short_video/appSwiper/index?id='+item.community_id+'&user='+user+'&uid='+this.uid+'&tab='+this.tab
                	//#endif
                	//#ifndef APP
                	url: '/pages/short_video/nvueSwiper/index?id='+item.community_id
                	//#endif
                });
			}else{
				let user = this.isAuth ? 1 : 0;
				
				uni.navigateTo({
					//#ifdef APP
					url: '/pages/short_video/appSwiper/index?id='+item.community_id+'&user='+user+'&uid='+this.uid+'&tab='+this.tab
					//#endif
					//#ifndef APP
					url: '/pages/short_video/nvueSwiper/index?id='+item.community_id+'&user='+user+'&uid='+this.uid+'&tab='+this.tab
					//#endif
				});
			}
		}
	}
		
}

</script>
<style lang="scss" scoped>
.wf-page2 .pictrue{
	width: 345rpx;
	height: 380rpx;
	border-radius: 8rpx; 
	position: relative;
	/deep/image,/deep/.easy-loadimage,/deep/.image{
		width: 100%;
		max-width: 345rpx;
		height: 380rpx;
		border-radius: 8rpx;
	}
	.video_img{
		width: 40rpx;
		height: 40rpx;
		position: absolute;
		top: 10rpx;
		right: 10rpx;
		z-index: 100;
		.image,image,uni-image{
			width: 40rpx;
			height: 40rpx;
		}
	}
	.plant-show{
		width: 42rpx;
		height: 42rpx;
		border-radius: 100%;
		background: rgba(0,0,0,.5);
		display: flex;
		align-items: center;
		justify-content: center;
		position: absolute;
		top: 10rpx;
		left: 10rpx;
		.iconfont{
			font-size: 20rpx;
			color: #fff;
			
		}
	}
}
 .loadfail-img{
	width: 100%;
  height: 345rpx;
}
.wf-page2 .text{
	padding:0 20rpx 20rpx;
	// width: 345rpx;
	.name{
		color: #7d7d7d;
		font-size: 28rpx;
		font-weight: bold;
	}
	.count{
		margin-top: 10rpx;
		justify-content: space-between;
        align-items: center;
		.author{
			align-items: center;
		}
		.author_name{
			margin-left: 10rpx;
			max-width: 120rpx;
			font-size: 24rpx;
			color: #7d7d7d;
			max-width: 180rpx;
		}
		.author_time{
			color: #7d7d7d;
		}
		.like{	
			font-size: 24rpx;
			color: #7d7d7d;
			display: flex;
			.like_count{
				display: flex;
				align-items: center;
			}
			.iconfont{
				font-size: 30rpx;
			}
			.icon-shoucang1{
				color: var(--view-priceColor);
			}
			.collect{
				font-size: 24rpx;
				margin-left: 5rpx;
			}
		}
	}
}
.wf-page2 .author .image,.wf-page2 .author uni-image{
	width: 46rpx;
	height: 46rpx;
	border-radius: 100%;
}
.approval_status{
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,.4);
	position: absolute;
	top: 0;
	left: 0;
	border-radius: 16rpx;
	color: #fff;
	text-align: center;
	z-index: 5;
	.approval_title{
		font-size: 28rpx;
		margin-top: 135rpx;
		font-weight: bold;
	}
	.approval_info{
		font-size: 24rpx;
		margin-top: 24rpx;
	}
}
.icon-shanchu2{
    color: rgba(255,255,255,.7);
        border: 1rpx solid rgba(255,255,255,.3);
        padding: 8rpx;
        border-radius: 50%;
        position: absolute;
        right: 0;
        top: 0;
        z-index: 999;
}
</style>
